Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR introduces the following pattern for verifying tokens and redirecting on success:
The idea of this pattern is that the algorithm behind
verfiy
returns aDict
of parameters -- which can be anything. Here I am imagining that this includes a unique hash representing the result of token verification (e.g. a key to a lookup table). This can then be used by the page located atconfig.success_redirect
to look up any data stored byverify
. Note thatparams
is allowed to benothing
(e.g. if token validation failed, or if this pattern is unused). Ifparams
isnothing
then no parameters are included byredirect_handler
.A simple use case for this is if
verify
stores the logged in user's name using a global dict. The value inparams
can then be used to look up the user's name. Eg:In this case
params
contains only the user UUID -- but it can be whatever your application needs.I'm thinking of how to generalize this to include a session cookie in the
redirect_handler
.